<include file="Public:header" />
<div class="container main"> <include file="Public:left" />
  <div class="w790">
    <style type="text/css">
    	#mission{text-align:center}
		#mission a{padding:5px 8px; margin:1px; background:#eee;}
		#mission span.current{padding:5px 8px; margin:1px; background:#F2F130; color:#fff;}
    </style>
    
    <script type="text/jscript">

	$(function(){
		//document.title = '民网在线 - 新工单添加';		//修改页面标题
		//初始化表单类型的选择的元素显示样式
		if($("#forms").val()==-1){
			$("#sub").attr('disabled','disabled');
		}else{
			$.post("{:U('Mission/getForm')}",{fid:$("#forms").val()},function(data){
			$("#sub").attr('disabled',false);
			$("#form").html(data['temp']);
			$("#fid").attr('value',data['fid']);
			},'json');
		}
		
		
		//获取选择的表单的ID 异步处理相对应的表单模型到页面
		$("#forms").change(function(){
			var id = $(this).val();
			if(id==-1){
				$("#form").html('');
				$("#sub").attr('disabled','disabled');
				return;
			}
			$.post("{:U('Mission/getForm')}",{fid:id},function(data){
			$("#sub").attr('disabled',false);
			$("#form").html(data['temp']);
			$("#fid").attr('value',data['fid']);
			
			setTimeout(function(data){
				$(".checkoutform:eq(0)").Validform({
			tiptype:3
	    });
		
			},1000);
			
			
			},'json');
		});
		
		//修改获取的表单的样式
		$("#form input").css("width:400px;");
		
		//使表单有验证功能
		$(".checkoutform:eq(0)").Validform({
			tiptype:3
	    });
		
		
	});
</script>
    
    
    
    
    <div class="h"><a href="{:U('index')}" class="btn btn-info"><i class="glyphicon glyphicon-circle-arrow-left"></i> 返回列表</a>
 </div>
    <form class="checkoutform" action="{:U('insert')}" enctype="multipart/form-data" method="post">
      <input type="hidden" name="is_list" value="1" />
      <div class="table_">
        <form id="dataform" action="{:U('insert')}" method="post" class="checkoutform">
                    <table class="table table-bordered">
                    	<table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
       <div class="form-group">
      <label class="col-sm-2 control-label">任务名</label>
      <div class="col-sm-10">
         <input class="form-control" datatype="*" name="title" nullmsg="请填写您问题。" type="text">
      </div>
   </div>
   
      <div class="form-group">
      <label class="col-sm-2 control-label">任务详述：</label>
      <div class="col-sm-10">
         <textarea class="form-control" name="detail" class="" nullmsg="请输入您的问题详述。" ></textarea>
      </div>
   </div>
   
      <div class="form-group">
      <label class="col-sm-2 control-label">选择任务类型</label>
      <div class="col-sm-10">
         <select class="form-control" name="forms" nullmsg="请选择问题类型！" id="forms">
          <option value="">请选择</option>
          <volist name="forms" id="vo">
           <option value="{$vo['id']}">{$vo['name']}</option>
          </volist>
        </select>
        </div>
        </div>  	
                    	
					
                    	                  
            </table>
      </div>
      <!--扩展结束-->
      <div class="pages">
       <div class="pages"><button type="submit" class="btn btn-success">提交</button></div>
      </div>
    </form>
  </div>
  <div class="clear"></div>
</div>
<include file="Public:footer" />